package cn.shyouchi.wuguanjia.android.ui.home.security.thread.main;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;

import com.bumptech.glide.Glide;

import cn.bingoogolapple.bgabanner.BGABanner;
import cn.shyouchi.wuguanjia.android.R;
import cn.shyouchi.wuguanjia.android.model.BannerModule;

/**
 * Created by Eenie on 2016/10/17 at 13:21
 * Email: 472279981@qq.com
 * Des:
 */

public class BannerAdapter implements BGABanner.Adapter {

    private Context mContext;

    public BannerAdapter(Context context) {
        this.mContext = context;
    }


    @Override
    public void fillBannerItem(BGABanner banner, View view, Object model, int position) {
        BannerModule module = (BannerModule) model;
        Glide.with(mContext)
                .load(module.getImgRes())
                .placeholder(R.mipmap.home_banner_default_bg1)
                .into((ImageView) view);
    }
}
